package com.mySampleApplication.client.components.item;

import com.smartgwt.client.widgets.form.fields.CanvasItem;
import com.smartgwt.client.widgets.form.fields.CheckboxItem;
import com.smartgwt.client.widgets.layout.VLayout;


public class SCheckboxItem {
    public static CanvasItem getCheckboxItem(){
        CheckboxItem checkboxItem1 = new CheckboxItem();
        checkboxItem1.setName("shanghai");
        checkboxItem1.setTitle("上海");

        CheckboxItem checkboxItem2 = new CheckboxItem();
        checkboxItem2.setName("chongqing");
        checkboxItem2.setTitle("重庆");

        CheckboxItem checkboxItem3 = new CheckboxItem();
        checkboxItem3.setName("guangzhou");
        checkboxItem3.setTitle("广州");

        checkboxItem1.setDefaultValue(false); // 默认不选中
        checkboxItem2.setDefaultValue(false); // 默认不选中
        checkboxItem3.setDefaultValue(false); // 默认不选中

       VLayout grids = new VLayout(10);
//        grids.setHeight(60);
//        grids.addMember(checkboxItem1);
//        grids.addMember(checkboxItem2);
//        grids.addMember(checkboxItem3);
        CanvasItem canvasItem = new CanvasItem("复选框");
        canvasItem.setCanvas(grids);
        return canvasItem;
    }
}
